module ApplicationHelper

  def active_by_action(action_n)
    'class="active"'.html_safe if action_name == action_n
  end

  def sub_collection_for_select(province_id)
    return [] if province_id.blank?
    province = Region.find province_id
    Region.where(parent_code: province.code).map{|r| [r.alias, r.id]}
  end
end
